package com.bibrApp.difu.fragment.cloudwallet_mvp;

import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bibrApp.difu.R;
import com.bibrApp.difu.utils.UIUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

public class CloudWalletAdapter extends BaseQuickAdapter<CloudWalletBean, BaseViewHolder> {
    public CloudWalletAdapter() {
        super(R.layout.item_cloudwallet, new ArrayList<>());
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, CloudWalletBean item) {

        TextView tvType = helper.getView(R.id.item_type);
        if (item.getCoinEunit().equals("BTC")) {
            UIUtils.setDrawableLeft(tvType, R.mipmap.img_btc_28);
            helper.setText(R.id.item_typename, "比特币");
        } else if (item.getCoinEunit().equals("USDT")) {
            UIUtils.setDrawableLeft(tvType, R.mipmap.img_usdt_28);
            helper.setText(R.id.item_typename, "Tether");
        } else {
            UIUtils.setDrawableLeft(tvType, R.mipmap.img_eth_28);
            helper.setText(R.id.item_typename, "以太币");
        }
        tvType.setText(item.getCoinEunit());
        helper.setText(R.id.tv_keyong, item.getColdMoney());
        helper.setText(R.id.tv_diya, item.getPawnMoney());
        helper.setText(R.id.tv_totle, item.getConvertTotalMoney());
        helper.addOnClickListener(R.id.tv_chongzhi, R.id.tv_tibi, R.id.tv_jiedai);
    }
}
